#ifndef GLOBALSMOOTHER_H 
#define GLOBALSMOOTHER_H

#include "ros/ros.h"
#include "global_refer.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <thread>
#include <boost/thread.hpp>
#include <string>
#include <eigen3/Eigen/Dense>
#include <tf/tf.h>
#include <glog/logging.h>
#include <nav_msgs/Odometry.h>
#include <geometry_msgs/PoseStamped.h>
#include "std_msgs/String.h"



#define YELLOW "\033[0;33m"
#define RESET "\033[0m" // 重置颜色

using namespace std;
using namespace Eigen; 
class GlobalSmoother
{
public:
  GlobalSmoother();
  ~GlobalSmoother();
  void processAndPublishData();
  void Odom(const nav_msgs::Odometry &msg);
  void Glob_receive(const geometry_msgs::PoseStamped &msg);
  void startThread();

private:
  Global_refer Gl;
  boost::thread* task_thread_;
  ros::NodeHandle nh;
  ros::Subscriber odom_;
  ros::Subscriber move_base_simple_sub_;

  nav_msgs::Odometry car_odom_;
  
  Eigen::MatrixXd hdmap_way_points;

  std::string csv_file_path;
  bool hasProcessed;
  double global_odom_x ;
  double global_odom_y ;
  double global_odom_yaw ;
  bool is_glob_receive = false;

};

#endif // GLOBALSMOOTHER_H
